# Where the pre-trained InceptionV3 checkpoint is saved to.
PRETRAINED_CHECKPOINT_DIR=mobilenet_v1_1.0_224

# Where the training (fine-tuned) checkpoint and logs will be saved to.
TRAIN_DIR=models

# Where the dataset is saved to.
DATASET_DIR=mydataset

# Fine-tune only the new layers for 1000 steps.
python3 train_image_classifier.py \
  --train_dir=models \
  --dataset_name=flowers \
  --dataset_split_name=train \
  --dataset_dir=mydataset \
  --model_name=mobilenet_v1 \
  --checkpoint_path=mobilenet_v1_1.0_224/mobilenet_v1_1.0_224.ckpt \
  --checkpoint_exclude_scopes=MobilenetV1/Logits,MobilenetV1/AuxLogits \
  --trainable_scopes=MobilenetV1/Logits,MobilenetV1/AuxLogits \
  --max_number_of_steps=1000 \
  --batch_size=32 \
  --learning_rate=0.01 \
  --learning_rate_decay_type=fixed \
  --save_interval_secs=60 \
  --save_summaries_secs=60 \
  --log_every_n_steps=100 \
  --optimizer=rmsprop \
  --weight_decay=0.00004

# Run evaluation.
python3 eval_image_classifier.py \
  --checkpoint_path=models \
  --eval_dir=models \
  --dataset_name=flowers \
  --dataset_split_name=validation \
  --dataset_dir=mydataset \
  --model_name=mobilenet_v1

# Fine-tune all the new layers for 500 steps.
python3 train_image_classifier.py \
  --train_dir=models/all \
  --dataset_name=flowers \
  --dataset_split_name=train \
  --dataset_dir=mydataset \
  --model_name=mobilenet_v1 \
  --checkpoint_path=models \
  --max_number_of_steps=500 \
  --batch_size=10 \
  --learning_rate=0.0001 \
  --learning_rate_decay_type=fixed \
  --save_interval_secs=60 \
  --save_summaries_secs=60 \
  --log_every_n_steps=10 \
  --optimizer=rmsprop \
  --weight_decay=0.00004

# Run evaluation.
python3 eval_image_classifier.py \
  --checkpoint_path=${TRAIN_DIR}/all \
  --eval_dir=${TRAIN_DIR}/all \
  --dataset_name=flowers \
  --dataset_split_name=validation \
  --dataset_dir=${DATASET_DIR} \
  --model_name=mobilenet_v1
  